package com.globallogic.dmytro_zakharenko.university;

import com.globallogic.dmytro_zakharenko.university.enums.AuditoriumNames;

public class Examination {
	
	private String mDate;
	private AuditoriumNames mAuditorium;

	/**
     * returns date of current exam
     * 
     * @return mDate
     */
	public String getmDate() {
		return mDate;
	}
	
	/**
     * set date for the current exam
     */
	public void setmDate(String mDate) {
		this.mDate = mDate;
	}
	
	/**
     * returns auditorium object for the current exam
     * 
     * @return mAuditorium
     */
	public AuditoriumNames getmAuditorium() {
		return mAuditorium;
	}
	
	/**
     * set auditorium object for the current exam
     */
	public void setmAuditorium(AuditoriumNames mAuditorium) {
		this.mAuditorium = mAuditorium;
	}	
	
	public boolean equals(Object other) {
		if (this == other) {
			return true;
		} 
		
		if (other == null) {
			return false;
		}
		
		if (!(other instanceof Examination)) {
			return false;
		}
		
		Examination otherA = (Examination) other; 
		return (mDate.equals(otherA.mDate) && mAuditorium.equals(otherA.mAuditorium));	
	}
	
	public int hashCode() {
		return (mDate.hashCode() + mAuditorium.name().hashCode());
	}
	
	public String toString() {
		return ("The Examination date is : " + mDate + " ;" + "and SetOff Auditorium is : " + mAuditorium + " ;");	
	}
}
